<template>
    <bi-form >
        <div style="min-height: 300px;">
        <bi-form-item label="变量类型">
            <bi-select v-model="type"  :clear="false"  >
                <bi-select-option value="goods" label="商品列表"></bi-select-option>
            </bi-select>
        </bi-form-item>
        <select-goods v-model="value"></select-goods>
        </div>
        <div style="display: flex; justify-content: flex-end;">
            <bi-button type="primary" @click="ok">确定</bi-button>
        </div>
        
    </bi-form>
</template>


<script>
import selectGoods from '../select-goods.vue';
export default{
    emits:['callback'],
    components:{
        selectGoods
    },
    data(){
        
        return {
            type:'goods',
            value:{}
        }
    },
    methods:{
        ok(){
           let str = 'VARIABLE#'+this.type+'#';
           let value = [];
           for(let name in this.value){
               if (this.value[name]=='') continue;
               value.push(name+':'+this.value[name]);
           }
           str += value.join('#');

           this.$emit('callback',str);
        }
    }
}
</script>